<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	template="/WEB-INF/templates/layoutCourtier.xhtml">


	<ui:define name="content">
		<h:form>

			<p:menu>
				<p:submenu label="">
					<p:menuitem value="Liste des polices" action="verslistepolices"
						icon="ui-icon ui-icon-star" />
				</p:submenu>
			</p:menu>

		</h:form>

		<h:form id="mainForm">


			<p:panel header="#{msgs.nouvellePolice}"
				style="width:50%;height:800px;">


				<p:fieldset legend="#{msgs.police}" toggleable="false">
					<h:outputText value="#{msgs.selectionnezClient}:" />
					<p:scrollPanel header="" style="width:200px;height:100px;">
						<p:dataTable var="client" id="client"
							value="#{manage.serviceClient.tousLesClients}"
							rowKey="#{client.key}" widgetVar="client"
							selection="#{manage.clientChoisi}" selectionMode="single">

							<p:ajax event="rowSelect" listener="#{manage.onRowSelectC}"
								update="mainForm " />

							<p:column filterBy="#{client.raisonSociale}"
								filterMatchMode="contains">
								<f:facet name="header">
									<h:outputText value="Clients" />
								</f:facet>
								<h:outputText value="#{client.raisonSociale}" />
							</p:column>

						</p:dataTable>

					</p:scrollPanel>

					<p:separator style="width:1px;height:1px" />

					<h:outputText value=" Sélectionnez un assureur: " />


					<p:scrollPanel header="" style="width:200px;height:100px;">
						<p:dataTable var="assureur"
							value="#{manage.serviceClient.tousLesAssureurs}"
							rowKey="#{assureur.key}" widgetVar="assureur"
							selection="#{manage.assureurChoisi}" selectionMode="single">
							<p:ajax event="rowSelect" listener="#{manage.onRowSelectA}"
								update="mainForm" />

							<f:facet name="header">

							</f:facet>

							<p:column filterBy="#{assureur.raisonSociale}"
								filterMatchMode="contains">
								<f:facet name="header">
									<h:outputText value="Assureurs" />
								</f:facet>
								<h:outputText value="#{assureur.raisonSociale}" />
							</p:column>


						</p:dataTable>


					</p:scrollPanel>

					<h:panelGrid columns="1" styleClass="container-horizontally-left"
						cellpadding="2">

						<h:outputLabel for="numeroPolice" value="#{msgs.numero}:" />
						<p:inputText id="numeroPolice"
							value="#{manage.police.numeroPolice}" required="true"
							requiredMessage="#{msgs.messageNumero}">
						</p:inputText>
						<p:message id="msgNumeroPolice" for="numeroPolice" />

						<h:outputLabel for="dateDebut" value="#{msgs.dateDebut}:" />
						<p:calendar id="dateDebut" pattern="dd/MM/yyyy"
							value="#{manage.police.dateDebut}" required="false" />
						<p:message id="msgDateDebut" for="dateDebut" />

						<h:outputLabel for="dateFin" value="#{msgs.dateFin}:" />
						<p:calendar id="dateFin" pattern="dd/MM/yyyy"
							value="#{manage.police.dateFin}" required="false" />
						<p:message id="msgDateFin" for="dateFin" />

						<h:outputLabel for="prime" value="#{msgs.prime}:" />
						<p:inputText id="prime" value="#{manage.police.prime}"
							required="true" requiredMessage="#{msgs.messagePrime}">
						</p:inputText>
						<p:message id="msgPrime" for="prime" />


					</h:panelGrid>


					<h:panelGroup>

						<h:panelGrid columns="3" style="width: 100%;"
							columnClasses="alignleft, aligncenter, alignright">


							<p:commandButton image="ui-icon ui-icon-refresh" immediate="true"
								style="width:120px" value="#{msgs.effacer}" action="refresh"
								ajax="false" />

							<p:commandButton image="ui-icon ui-icon-disk" style="width:120px"
								value="#{msgs.enregistrer}" action="#{manage.ajouterPolice}"
								ajax="false" disabled="#{manage.bouton2Desactive}" />

						</h:panelGrid>
					</h:panelGroup>

				</p:fieldset>


			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>